package br.com.flavios.selenium.dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class TestDao {

	public static void main(String[] args) throws SQLException {
		Connection c = DriverManager.getConnection("jdbc:hsqldb:file:/prj/db/selfbib", "sa", "");
		
		Statement st = c.createStatement();
		st.execute("select * from testamento");
		
		ResultSet rs = st.getResultSet();
		while (rs.next()) {
			
			extraiMeuMetodo(rs);
			
		}
		st.execute("SHUTDOWN");
	}

	private static void extraiMeuMetodo(ResultSet rs) throws SQLException {
		System.out.println(rs.getString("id"));
		System.out.println(rs.getString("nome"));
		System.out.println(rs.getString("ididioma"));
	}
}
